function defineReactive(obj, key, val) {
  Object.defineProperty(obj, key, {
    get() {
      console.log("get", key);
      return val;
    },
    set(newVal) {
      if (newVal != val) {
        console.log("set", key, newVal);
        val = newVal;
      }
    },
  });
}
const obj = {};
defineReactive(obj, "foo", { name: "jack" });
obj.foo;
obj.foo.name = "fooooo";
